<div class="frame_configDiv">
<form name="configForm" id="configForm" action="administrator-system-dosendmail" method="post">
  <table width="100%" border="1" cellpadding="0" cellspacing="0" bordercolor="#c8d9e9">
  	<tr>
	  <td colspan="2">广告邮件设置</td>
	</tr>	
	<tr>
      <td valign="top" class="ri-bbgg">按注册时间筛选会员：</td>
      <td class="le"><input type="text" class="configInput" value="<?php echo date('Y-m-d H:i:s', time());?>" name="time1" />-<input type="text" class="configInput" value="<?php echo date('Y-m-d H:i:s', time());?>" name="time2" /></td>
    </tr>
	<tr>
      <td valign="top" class="ri-bbgg"> 广告邮件主题：</td>
      <td class="le"><input type="text" class="configInput" value="<?=$this->configArray['AD_EMAIL_SUBJECT']?>" name="AD_EMAIL_SUBJECT" /></td>
    </tr>
	<tr>
      <td valign="top" class="ri-bbgg"> 广告邮件内容：</td>
      <td class="le">
	  	<?=$this->oFCKeditor->Create();?>
	  </td>
    </tr>
	<tr>
      <td colspan="2" class="se" align="center">
      	<input type="button" class="iput" value="预览"   onclick="preview();" />　
        <input type="button" class="iput" value="发送"   onclick="checkform();" />　　
        <input type="button" class="iput" value="返 回" onclick="commonEffection.confirmBack();" />
      </td>
    </tr>
  </table>
  </form>
</div>
<form name="previews" id="previews" method="post" action="/administrator-system-preview" target="_blank">
	<input type="hidden" name="time5"></input>
	<input type="hidden" name="time6"></input>
	<input type="hidden" name="subject"></input>
	<input type="hidden" name="content"></input>
</form>
<script src="/fckeditor/fckeditor.js"></script>
<script>
function preview()
{
	time1 = $('input[name="time1"]').val();
	time2 = $('input[name="time2"]').val();
	subject = $('input[name="AD_EMAIL_SUBJECT"]').val();
	content = FCKeditorAPI.GetInstance('AD_EMAIL_BODY').GetXHTML(true);
	$('input[name="time5"]').val(time1);
	$('input[name="time6"]').val(time2);
	$('input[name="subject"]').val(subject);
	$('input[name="content"]').val(content);
	$('#previews').submit();
}

function checkform(){
	var isTrue=true;
	
	if(isTrue){
		$('#configForm').submit();
	}else{
		alert('请填写完整所有信息!');
	}
}
</script>